﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/MainContent.Master"
    Inherits="System.Web.Mvc.ViewPage<MShop.Core.Domain.ItemProp>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    创建属性
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="fullBox">
        <div id="formOutBox">
            <div id="formTitle">
                <div class="formTitleCard_c">
                    创建属性</div>
                <div class="formTitlRight">
                    <img src="/Content/back.png" width="16" height="16" border="0" align="middle" style="margin-right: 3px;" />
                    <%: Html.ActionLink("返回", "Index") %>
                </div>
            </div>
            <div id="formBox">
                <% Html.EnableClientValidation(); %>
                <% using (Html.BeginForm())
                   {%>
                <%: Html.ValidationSummary(true) %>
                <table width="100%" border="0" cellspacing="0" cellpadding="3" class="formTable">
                 <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.ParentId) %>
                        </td>
                        <td>
                            <%: Html.DropDownListFor(model => model.ParentId, ViewData["selectlist"] as IEnumerable<SelectListItem>)%>
                            <%: Html.ValidationMessageFor(model => model.ParentId)%>
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                     <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.Props) %>
                        </td>
                        <td>
                            <%: Html.DropDownList("PropId", Model.Props, new { @onchange = "showColor();" })%>
                            <%: Html.ValidationMessageFor(model => model.Props)%>
                            <span id="spanColor" style="display:none;">
                                <%: Html.LabelFor(model => model.IsColorProp)%><%: Html.EditorFor(model => model.IsColorProp)%>
                               
                            </span>
                            <script type="text/javascript">
                                var showColor = function () {
                                    if ($('#PropId').val() == "3") {
                                        $('#spanColor').show();
                                    }
                                    else {
                                        $('#spanColor').hide();
                                        $('#IsColorProp').attr("checked", "");
                                    }
                                }
                            </script>
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.Name) %>
                        </td>
                        <td>
                            <%: Html.EditorFor(model => model.Name)%>
                            <%: Html.ValidationMessageFor(model => model.Name)%>
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.PropType)%>
                        </td>
                        <td>
                            <%: Html.DropDownListFor(model => model.PropType, ViewData["ItemPropType"] as IList<SelectListItem>)%>
                            <%: Html.ValidationMessageFor(model => model.PropType)%>
                           
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr id="spanV" style="display: none;">
                        <td width="80">
                            <%: Html.LabelFor(model => model.Multi)%>
                        </td>
                        <td>
                            <%: Html.EditorFor(model => model.Multi)%>
                            <%: Html.ValidationMessageFor(model => model.Multi)%>
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr id="spanV2" style="display: none;">
                        <td width="80">
                            <%: Html.LabelFor(model => model.PropValues)%>
                        </td>
                        <td>
                            <%: Html.EditorFor(model => model.PropValues)%>
                            <%: Html.ValidationMessageFor(model => model.PropValues)%>
                            请输入选项，1行表示一个选项，如果为空，则转换为单行文本类型。
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                     
                     
                 
                    <tr>
                        <td colspan="3" align="center">
                            <input type="submit" value="创建" class="btn" />
                        </td>
                    </tr>
                </table>
                <% } %>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">
    <script type="text/javascript">
    $(document).ready(function () {
        $('#PropType').change(function () {           
            if ($('#PropType').val() == '2' ) {
                $('#spanV').show();
                $('#spanV2').show();
            }
            else {
                $('#spanV').hide();
                $('#spanV2').hide();
            }

        });     
             
    });
   
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphFooter" runat="server">
</asp:Content>
